package apps.kine.android.traxxsalon;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;

public class MainActivity extends Activity implements OnClickListener {
	private static final String TAG = "MainActivity";

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.main);
	}

	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.quickBookingButton:
			launchQuickBookActivity();
			break;

		case R.id.contactButton:
			launchContactInfoActivity();
			break;

		default:
			break;
		}
	}

	private void launchQuickBookActivity() {
		startActivity(new Intent(this, QuickBookingActivity.class));
	}

	private void launchContactInfoActivity() {
		startActivity(new Intent(this, ContactInfoActivity.class));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.about, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.menu_about: {
			Util.INSTANCE.displayAboutScreen(this);
			return true;
		}
		}
		return false;
	}
}